package org.jix.weblog.module.common.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @Author Jix
 * @Date 2024/9/7 10:59
 * @注释
 */

@Configuration
public class MinioConfig {

    @Autowired
    private MinioProperties minioProperties;
    @Bean
    public MinioClient MinioClient() {
        //构建minio客户端
        return MinioClient.builder()
                .endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
                .build();
    }
}
